<!--
/**
* @author xuyh0817
* @email xuyh0817@foxmail.com
* @date 2022-03-19 22:57
* @version 2.0.0
* @doc todo
* @website todo
* @remark  如果要分发源码，需在本文件顶部保留此文件头信息！！
*/
-->
<template>
  <!--  布局的整体插槽-->
  <x-render-extend-slot
    v-if="hasSlot(attrs.layoutName)"
    :componentFunc="getSlot(attrs.layoutName)"
    :data="attrs"
  ></x-render-extend-slot>
  <a-card v-else v-bind="attrs" style="width: 100%;">
    <x-render-form-row
      :data="children"
      v-on="$listeners">
    </x-render-form-row>
  </a-card>
</template>

<script>
import { COMPONENT_TYPE } from '../../constants'
import XRenderExtendSlotMixin from '../../XRenderMixins/XRenderExtendSlotMixin'
import XRenderComponentMixin from '../../XRenderMixins/XRenderComponentMixin'

export default {
  name: COMPONENT_TYPE.LAYOUT_CARD,
  mixins: [XRenderComponentMixin, XRenderExtendSlotMixin],
  computed: {
    children: {
      get() {
        const { attrs } = this
        return attrs.children || []
      }
    }
  }
}
</script>
